package com.hmdp.handler;

import com.hmdp.dto.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class ExceptionHandler {
    public Result exceptionHandler(RuntimeException e) {
        log.error(e.getMessage());
        return Result.fail(e.getMessage());
    }
}
